package swf;

class RecordHeader {
	public static function create ( tagID : Int, length : Int, ?long : Bool ) : String {
		if( (length > 62) || (long == true) ) {
			return UI16.fromInt( ((tagID & (-1 >>> 22)) << 6) | 0x3f ) + SI32.fromInt( length );
		} else {
			return UI16.fromInt( ((tagID & (-1 >>> 22)) << 6) | (length & (-1 >>> 26)) );
		}
	}
}
